from lib.config.index import wifi_config
from lib.log.index import wlan_logger


class WLAN():
    WLAN_STATUS = {
            "disconnected": 0,
            "connected": 1,
            "pending": 2,
    }

    def __init__(self):
        self.__ssid = wifi_config.get_ssid()
        self.__password = wifi_config.get_password()
        self.__hostname = wifi_config.get_hostname()
        self.__status = WLAN.WLAN_STATUS["disconnected"]

    def connect(self):
        wlan_logger.log(f"connect wifi({self.__ssid},{self.__password})")
        self.__status = WLAN.WLAN_STATUS["pending"]

    def disconnect(self):
        wlan_logger.log(f"disconnect wifi({self.__ssid},{self.__password})")
        self.__status = WLAN.WLAN_STATUS["disconnected"]

    def is_connected(self):
        wlan_logger.log(f"wlan base: is_connected")

    def scan(self):
        wlan_logger.log(f"scan wifi")
